﻿/*
 * OpenDoPE Word Add-In
 * Copyright (C) 2010-2011  Plutext Pty Ltd
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
 * 
 * For details, see http://www.gnu.org/licenses/gpl-2.0.html
 */

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace OpenDoPE_Wed
{
    public partial class UserControlBoundInfo : UserControl
    {
        WedTaskPane taskpane;

        public UserControlBoundInfo(WedTaskPane taskpane)
        {
            InitializeComponent();
            this.taskpane = taskpane;
        }

        private void buttonXml_Click(object sender, EventArgs e)
        {
            taskpane.Controls.Remove(this);

            if (taskpane.cxp.Count > 1)
            {
                taskpane.addPartsListBox();
            }

            taskpane.addXmlEditor(taskpane.cxp[0], ".xml", true);

            // Populate existing values
            TagData td = new TagData(taskpane.currentCC.Tag);
            taskpane.populateXPathInfo(td.get("od:xpath"));


            taskpane.bindButtons = new UserControlBindButtons(taskpane);
            taskpane.bindButtons.Location = new Point(10, 540);
            this.Controls.Add(taskpane.bindButtons);

            taskpane.Refresh();
        }

    }
}
